package com.gk.study.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gk.study.entity.Homework;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface HomeworkMapper extends BaseMapper<Homework> {
    List<Homework> selectByTeacherId(@Param("teacherId") Long teacherId);
    List<Homework> selectByCourseId(@Param("courseId") Long courseId);

    /**
     * 根据学生ID和状态查询作业
     * @param studentId 学生ID
     * @param status 作业状态 (0-未完成 1-待批改 2-已批改)
     * @return 作业列表
     */
    List<Homework> selectByStudentAndStatus(
            @Param("studentId") Long studentId,
            @Param("status") Integer status
    );

    List<Homework> selectWithCourseByTeacher(@Param("teacherId") Long teacherId);

    List<Long> selectStudentsByTeacher(@Param("teacherId") Long teacherId);
}